/**
 * Created by fanweihua on 2016/12/1.
 */
import React from 'react';
import SliderHtml from './sliderHtml.js';

const SliderNav = React.createClass({
    componentDidMount: function () {
        SliderHtml._go();
    },
    render(){
        return (
            <div className="Z_panel-body">
                <div className="page__hd">
                    <h1 className="page__title">Slider</h1>
                    <p className="page__desc">滑块</p>
                </div>
                <div className="page__bd page__bd_spacing">
                    <div className="weui-slider">
                        <div className="weui-slider__inner">
                            <div className="weui-slider__track"></div>
                            <div className="weui-slider__handler"></div>
                        </div>
                    </div>
                    <br></br>
                    <div className="weui-slider-box">
                        <div className="weui-slider">
                            <div id="sliderInner" className="weui-slider__inner">
                                <div id="sliderTrack" style={{width: "50%"}} className="weui-slider__track"></div>
                                <div id="sliderHandler" style={{left: "50%"}} className="weui-slider__handler"></div>
                            </div>
                        </div>
                        <div id="sliderValue" className="weui-slider-box__value">50</div>
                    </div>
                </div>
            </div>
        );
    }
});
const Slider = React.createClass({
    getInitialState: function () {
        return {
            html: SliderHtml.html,
            javaScriptHtml: SliderHtml.javaScriptHtml
        }
    },
    render(){
        return (
            <div className="Z_slideIn">
                <div className="page slideIn">
                    <div className="Z_content_code">
                        <div dangerouslySetInnerHTML={{__html: this.state.html}}></div>
                        <div dangerouslySetInnerHTML={{__html: this.state.javaScriptHtml}}></div>
                    </div>
                </div>
                <div className="Z_content">
                    <div className="Z_panel-body-backgound">
                        <SliderNav></SliderNav>
                    </div>
                </div>
            </div>
        );
    }
});
module.exports = Slider;